<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml">

    <ui:define name="title">
        DataTable <span class="subitem">Paginator</span>
    </ui:define>

    <ui:define name="description">
        DataTable provides a highly customizable ajax paginator.
    </ui:define>

    <ui:param name="documentationLink" value="/components/datatable"/>
    <ui:param name="widgetLink" value="DataTable-1"/>

    <ui:define name="implementation">
        <div class="card">
            <h:form>
                <p:dataTable var="customer" value="#{dtPaginatorView.customers}" rows="10"
                             paginator="true" paginatorPosition="both"
                             paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records"
                             rowsPerPageTemplate="5,10,{ShowAll|'All'}">

                    <p:column headerText="Name">
                        <h:outputText value="#{customer.name}" />
                    </p:column>

                    <p:column headerText="Country">
                        <h:outputText value="#{customer.country.name}" />
                    </p:column>

                    <p:column headerText="Company">
                        <h:outputText value="#{customer.company}" />
                    </p:column>

                    <p:column headerText="Representative">
                        <h:outputText value="#{customer.representative.name}" />
                    </p:column>

                    <f:facet name="paginatorTopLeft">
                        <p:commandButton type="button" icon="pi pi-refresh"/>
                    </f:facet>

                    <f:facet name="paginatorBottomRight">
                        <p:commandButton type="button" icon="pi pi-cloud-upload"/>
                    </f:facet>

                </p:dataTable>
            </h:form>
        </div>
    </ui:define>

</ui:composition>
